<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>标签元素的查找</title>
</head>
<body>
    <div id="app">
        <div class="hd"></div>
        <div class="hdms"></div>
        <div class="xia"></div>
    </div>
    <script>
        const app = document.querySelector("#app");
        const hdms = document.querySelector(".hdms");

        // 获取所有的子标签
        console.log(app.children);

        // 获取第一个子标签
        console.log(app.firstElementChild);

        // 获取最后一个子标签
        console.log(app.lastElementChild);

        // 获取父级标签
        console.log(app.parentElement);

        // 获取上一个兄弟标签
        console.log(hdms.previousElementSibling);

        // 获取下一个兄弟标签
        console.log(hdms.nextElementSibling);
    </script>
</body>
</html>